import { createStore, createLogger } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import cart from './modules/cart'
import user from './modules/user'
import category from './modules/category'
export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    cart,
    user,
    category
  },
  // 数据持久化储存的插件配置
  plugins: [
    createLogger(),
    createPersistedstate({
      // key名称
      key: 'erabbit-client-pc-store-69',
      // 需要持久化的模块
      paths: ['user', 'cart']
    })
  ]
})
